﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IDE
{
    public partial class Form2 : Form
    {
        RichTextBox b;
        RichTextBox c;
        public string aff;
        public Form2(RichTextBox r, RichTextBox t)
        {
            InitializeComponent();
            b = r;
            c = t;
        }
        
        private void Form2_Load(object sender, EventArgs e)
        {

        }

        private void b_remplacertt_Click(object sender, EventArgs e)
        {
            string search = c_rechercher2.Text;
            string rempl = c_remplacer.Text;
            b.Text = b.Text.Replace(search, rempl);
        }

        private void b_rechercher_Click(object sender, EventArgs e)
        {
            string search = c_rechercher1.Text;
            string chaine = b.Text;
            Console.WriteLine(chaine);
            Console.WriteLine(search);

            if (chaine.Contains(search))
                c.Text = "trouvée";
            else
                c.Text = "recheche pas trouvée";
        }
    }
}
 